<template>
        <div class="goodsEntry">
                <div style="padding:20px">
                        <el-button type="primary" @click="returnOver">返回</el-button>
                        <el-button type="primary" @click="Seeinfo">查看详情</el-button>
                </div>
            <!-- <div style="padding:20px;height:30px">
                <span>盘点编号：</span>
                <span>仓库：</span>
                <span>盘点SKU种类量：</span>
                <el-button type="primary" size="medium" @click="Keepinventory" style="float:right">保存盘点结果</el-button>
            </div> -->
            <!-- <el-form :inline="true" style="padding: 0 20px">
                    <el-form-item label="盘点编号：">
                    </el-form-item>
                    <el-form-item label="">
                    </el-form-item>
                    <el-form-item label="">
                    <el-button type="primary" size="medium" @click="smentry()">保存盘点结果</el-button>
                    </el-form-item>
            </el-form> -->
            <!-- <el-form :inline="true" style="padding: 0 20px">
                <el-form-item label="">
                <el-input v-model="goodsId" autofocus @keyup.enter.native="smentry"  style="width:250px" placeholder="请录入商品ID"></el-input>
                </el-form-item>
                <el-form-item label="">
                <el-button type="primary" size="medium" @click="smentry()">确定录入</el-button>
                </el-form-item>
            </el-form> -->
            <div class="wrapper">
                    <el-table class="table" :data="tableData" stripe highlight-current-row border>
                        <el-table-column
                        type="index"
                        width="50">
                      </el-table-column>
                      <el-table-column align="center" type="selection">
                      </el-table-column>
                      <el-table-column align="center" prop="goods_no" label="商品编号">
                      </el-table-column>
                      <el-table-column align="center" prop="goods_name" label="商品名称">
                      </el-table-column>
                      <el-table-column align="center" prop="sku_no" label="SKU编码">
                      </el-table-column>
                      <el-table-column align="center" prop="odorType" label="香型">
                      </el-table-column>
                      <el-table-column align="center" prop="netContent" label="净含量">
                      </el-table-column>
                      <el-table-column align="center" prop="alocohl" label="酒精度">
                        </el-table-column>
                     <el-table-column align="center" prop="unit" label="单位">
                      </el-table-column>
                      
                      <el-table-column align="center" prop="systemPcs" label="系统数量">
                      </el-table-column>
                      
                      <el-table-column align="center" prop="checkPcs" label="盘点数量">
                      </el-table-column>
                      <el-table-column align="center" prop="outPcs" label="盘赢">
                      </el-table-column>
                      <el-table-column align="center" prop="diffPcs" label="盘亏">
                    </el-table-column>
                      <el-table-column align="center" prop="description" label="备注">
                      </el-table-column>
                      <!-- <el-table-column align="center" prop="address" label="操作" width="150">
                        <template slot-scope="scope">
                          <span class="canceloff-btn" @click="Seeinfo(scope.row)">查看</span>
                        </template>
                      </el-table-column> -->
                    </el-table>
                    <!-- <el-pagination background layout="total,prev, pager, next,jumper" :page-size="page.pageSize" :total="page.total" :current-page="page.current"
                      @current-change="handleCurrentChange">
                    </el-pagination> -->
                    <div style="height:80px">
                            <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="page.current"
                            :page-sizes="[10,20,30]"
                            :page-size="page.pageSize"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="page.total">
                          </el-pagination>
                    </div>
                    
                  </div>
                  <audio id="myaudio" src="../../../viode/004.mp3" controls="controls" hidden="hidden" ></audio>
                  <audio id="warn" src="../../../viode/warn.mp3" controls="controls"  hidden="hidden"></audio>
                  <div>
                      备注信息：{{sumDesc}}
                    <!-- <el-form :inline="true" style="padding: 0 20px;width:300px">
                            <el-form-item label="" prop="desc" >
                                <el-input type="textarea" style="width:800px" placeholder="请输入单据备注"></el-input>
                            </el-form-item>
                            </el-form>
                            
                         </el-form> -->
                  </div>
                  <!-- <div style="padding:20px;">
                      <span>盘点人</span>
                      <span>盘点时间</span>
                </div> -->
                 
                  
        </div>
    </template>
    <script>
        export default{
            data(){
                return{
                    tableData: [],
                    page: {
                    pageSize: 10,
                    current: 1,
                    total: null
                  },
                  goodsId:'',
                  checkNo:this.$route.query.id,
                  sumDesc:''
                }
            },
            mounted () {
               this.inintable(); 
            },
            methods: {
                //二维码录入
              smentry(){
                if(this.storeId == '' && this.inputAreaId == ''){
                  this.$message({
                      type: "error",
                      message: '请选择仓库和货位'
                     });
                }else{
                  this.factoryGoods();
                  this.goodsId = '';
                }
              },
              //音频录入
              autoplays(){
                 let audio =  document.getElementById('myaudio')
                 audio.currentTime = 0
                 audio.play();
                // this.$netxTick(function(){
                  // console.log(document.getElementById('myaudio'), 999)
                   
                //  })
               },
               //
               warnplay(){
                 let warn = document.getElementById('warn');
                 warn.currentTime = 0
                 warn.play();
               },
                returnOver(){
                    this.$router.go(-1);
                },
                Seeinfo(){
                    this.$router.push({path:'/factphydetail',query:{checkNo:this.$route.query.id}});
                },
                //保存
                Keepinventory(){
                    this.$router.push({path:'/FactoryphysicalCount'});
                },
                handleSizeChange(){

                },
                handleCurrentChange(){
                    
                },
                async inintable(){
                    try{
                        let {data} = await this.$post({
                            api:'/show/allcheck',
                            data:{
                                current:this.page.current,
                                pageSize:this.page.pageSize,
                                checkNo:this.$route.query.id,
                                startTime:'',
                                endTime:'',
                                checkStatus:1
                            }
                        })
                        if(data.code === 0){
                            this.tableData = data.data;
                            this.sumDesc = data.data[0].sumDesc || ''
                            this.page.total = data.rdPage.total;
                            console.log(data)
                        }
                    }catch(error){

                    }
                }
            }
        }
    </script>
    <style>
       .goodsEntry{
           margin: 20px;
       }
    </style>